<?php 
class Acl extends Zend_Acl {
  public function __construct() {

  	$this->addRole(new Zend_Acl_Role('guest'));
    $this->addRole(new Zend_Acl_Role('user'), 'guest');
 
    $this->add(new Zend_Acl_Resource('admin'));
    $this->add(new Zend_Acl_Resource('auth'));
    $this->add(new Zend_Acl_Resource('error'));
    $this->add(new Zend_Acl_Resource('index'));
    $this->add(new Zend_Acl_Resource('cars'));
    $this->add(new Zend_Acl_Resource('news'));
 
    
    $this->allow('user');
    $this->allow('user','admin');
    $this->allow('user','auth');
    $this->allow('user','cars');
    $this->allow('user','error');
    $this->allow('user','index');
    
    
    $this->allow('guest', 'auth');
    $this->allow('guest', 'news','index');
    $this->allow('guest', 'news','view');
    
    $this->allow('guest', 'cars', 'colors');
    $this->allow('guest', 'cars', 'photo');
    $this->allow('guest', 'cars', 'testdrive');
    $this->allow('guest', 'cars', 'colors');
    $this->allow('guest', 'cars', 'colors');
    $this->allow('guest', 'cars', 'options');
    $this->allow('guest', 'cars', 'list');
    $this->allow('guest', 'cars', 'view');
    $this->allow('guest', 'cars', 'description');
    $this->allow('guest', 'auth');
    $this->allow('guest', 'error');
    $this->allow('guest', 'index');
  }
}